package com.naxian.service.Impl;

import com.naxian.mapper.CompanyReceivedMapper;
import com.naxian.pojo.CompanyReceived;
import com.naxian.pojo.CompanyReceivedExample;
import com.naxian.service.company.CompanyReceivedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CompanyReceivedServiceImpl implements CompanyReceivedService {
    @Autowired
    private CompanyReceivedMapper companyReceivedMapper;
    @Override
    public boolean insert(CompanyReceived companyReceived) {
        int row= companyReceivedMapper.insert(companyReceived);
        return row>0;

    }

    @Override
    public List<CompanyReceived> getByResumeId(int resumeId, int recruitId) {
        CompanyReceivedExample example = new CompanyReceivedExample();
        CompanyReceivedExample.Criteria criteria = example.createCriteria();
        criteria.andResumeIdEqualTo(resumeId);
        criteria.andRecIdEqualTo(recruitId);

       List<CompanyReceived> receivedList = this.companyReceivedMapper.selectByExample(example);
        return receivedList;
    }
}
